package com.bifrost.service;

import com.bifrost.common.base.ServerResponse;
import com.bifrost.entity.CouponDetail;
import com.bifrost.entity.MerchantStore;
import com.bifrost.entity.User;
import com.bifrost.model.coupon.WXCouponDetailRO;
import com.bifrost.model.coupon.WXCouponDetailVO;
import com.bifrost.model.coupon.WXCouponTotalRO;
import com.bifrost.model.coupon.WXCouponTotalVO;
import com.bifrost.model.ro.coupon.CouponDetailFilterRO;
import com.bifrost.model.ro.coupon.CouponFilterRO;
import com.bifrost.model.ro.coupon.CouponRO;
import com.bifrost.model.ro.coupon.CouponTypeRO;
import com.bifrost.model.vo.PageVO;
import com.bifrost.model.vo.coupon.CouponVO;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * @author rangf
 * @date 2018/5/7
 */
public interface AdminCouponService {

    /**
     * 添加优惠券类型
     *
     * @param user user
     * @param ro ro
     * @return
     */
    ServerResponse addCouponType(User user, CouponTypeRO ro);

    /**
     * 更新优惠券类型
     *
     * @param user user
     * @param ro ro
     * @return
     */
    ServerResponse updateCouponType(User user, CouponTypeRO ro);

    /**
     * 优惠券类型列表
     *
     * @param user user
     * @return
     */
//    List<CouponTypeRO> listCouponType(User user);

    /**
     * 删除优惠券类型
     *
     * @param couponTypeIds couponTypeIds
     * @return
     */
    ServerResponse deleteCouponType(Long[] couponTypeIds);

    /**
     * 添加优惠券
     *
     * @param user user
     * @param ro ro
     * @return
     */
    ServerResponse addCoupon(User user, CouponRO ro);

    /**
     * 优惠券审核通过：批量
     *
     * @param user user
     * @param couponIds couponIds
     * @return
     */
    ServerResponse authBatchCoupon(User user, Long[] couponIds);

    /**
     * 优惠券审核
     *
     * @param user user
     * @param couponId couponId
     * @param authType authType
     * @return
     */
    ServerResponse auth(User user, Long couponId, String authType);

    /**
     * 更新优惠券
     *
     * @param user user
     * @param ro ro
     * @return
     */
    ServerResponse updateCoupon(User user, CouponRO ro);

    /**
     * 删除优惠券
     *
     * @param couponIds couponIds
     * @return
     */
    ServerResponse deleteCoupon(Long[] couponIds);

    /**
     * 优惠券列表
     *
     * @param merchantStore merchantStore
     * @param ro ro
     * @param merchantStoreIdList
     * @return
     */

    PageVO<CouponVO> listCoupon(MerchantStore merchantStore, CouponFilterRO ro, List<Long> merchantStoreIdList);

    /**
     * 优惠券明细
     *
     * @param ro ro
     * @return
     */
    Page<CouponDetail> listCouponDetail(CouponDetailFilterRO ro);

    /**
     * 自动生成优惠券明细
     *
     * @param couponId authed coupon
     */
    void autoGenerateCouponDetail(Long couponId);

    PageVO listWXCouponDetail(WXCouponDetailRO ro, List<Long> merchantStoreIdList, boolean exportFlag);

    PageVO<WXCouponTotalVO> listWXCouponTotal(WXCouponTotalRO ro, List<Long> merchantStoreIdList, boolean b);

    List<WXCouponTotalVO> exportWXCouponTotal(WXCouponTotalRO ro, List<Long> merchantStoreIdList);

    List<WXCouponDetailVO> exportWXCouponDetail(WXCouponDetailRO ro, List<Long> merchantStoreIdList);
}
